package com.mysoft.gfyx.marketdevelop.service;

import com.mysoft.framework.modeling.dto.*;
import com.mysoft.framework.modeling.enums.LabelStyle;
import com.mysoft.gfyx.marketdevelop.service.dto.TagDto;
import com.mysoft.gfyx.marketdevelop.service.dto.label.LabelApplicationSettingDto;
import com.mysoft.gfyx.marketdevelop.service.dto.label.LabelValueSettingDto;

import java.util.*;

/**
 * 标签服务
 */
public interface LabelService {

    String LABEL_TOP_COMPANY_TYPE = "top_company_type_label";
    String LABEL_COMPANY_TYPE = "company_type_label";
    String LABEL_PROJECT_TYPE = "property_category_label";
    String LABEL_FITMENT_TYPE = "fitment_fee_label";
    String LABEL_SELL_STATUS = "sell_status_label";
    String LABEL_LAND_TYPE = "land_usage_label";
    String LABEL_ACTIVITY = "developer_activity_label";

    String SCENE_DEVELOPER_MAIN = "developer_main";

    Map<String, LabelStyle> labelStyles = new HashMap<String, LabelStyle>() {{
        // 营业状态
        put("在营", LabelStyle.Success);
        put("其他", LabelStyle.Success);
        put("吊销", LabelStyle.Danger);
        put("注销", LabelStyle.Danger);
        put("删除", LabelStyle.Danger);
        put("撤销", LabelStyle.Danger);
        put("停业", LabelStyle.Danger);

        // 企业类型
        put("上市企业", LabelStyle.Primary);
        put("上市", LabelStyle.Primary);
        put("国企", LabelStyle.Primary);
        put("民企", LabelStyle.Primary);
        put("港澳台", LabelStyle.Primary);
        put("外资", LabelStyle.Primary);
        put("集体所有制", LabelStyle.Primary);
        put("个体户", LabelStyle.Primary);
        put("合资", LabelStyle.Primary);
        put("事业单位", LabelStyle.Primary);
        put("国有控股", LabelStyle.Primary);
        put("央企控股", LabelStyle.Primary);

        // Source
        put("云采购平台", LabelStyle.Primary);
        put("官网招标", LabelStyle.Primary);
        put("公告交易中心", LabelStyle.Primary);
        put("平台招募", LabelStyle.Primary);

        // 报名状态
        put("报名中", LabelStyle.Danger);
        put("已截止", LabelStyle.Default);

        // 特色标签
        put("地产百强", LabelStyle.Primary);
        put("新精装客群", LabelStyle.Primary);
        put("新住宅客群", LabelStyle.Primary);
        put("新区域拓展", LabelStyle.Primary);
        put("高端项目客群", LabelStyle.Primary);

        // 工程单位标签
        put("云采购平台认证", LabelStyle.Primary);
        put("上市", LabelStyle.Primary);
        put("高新技术产业", LabelStyle.Primary);
        put("精选供应商", LabelStyle.Primary);
        put("国家级别技术中心", LabelStyle.Primary);
        put("云采购平台认证", LabelStyle.Primary);
    }};

    List<LabelStyleConfig> loadData(String values);

    List<LabelStyleConfig> loadLabelFromCommaString(String values);

    List<List<LabelStyleConfig>> batchLoadLabelFromCommaString(ArrayList<String> values);

    String extractAndDeleteTagValueNameWithTagName(ArrayList<Map<String, Object>> tags, DeveloperService.TjEntity entity, String tagName);

    List<OptionItem> loadValueTo0ValueTagsByTagName(DeveloperService.TjEntity entity, String tagName);

    ArrayList<String> getTags(DeveloperService.TjEntity entity, List<String> tags);

    boolean setLabelApplication(LabelApplicationSettingDto label);

    ArrayList<TagDto> getTagsByScene(DeveloperService.TjEntity entity, String scene);

    boolean setLabelValue(LabelValueSettingDto label);

    ArrayList<TagDto> getAllTagsData(DeveloperService.TjEntity entity);

    List<OptionItem> DeveloperSmartTag();

    List<OptionItem> DeveloperTag();

    List<OptionItem> loadValueTagsPrjFunction(int type);

    List<OptionItem> loadValueTagsPrjProperty(int type);

    List<OptionItem> loadValueTagsLandType(int type);

    List<OptionItem> loadValueTagsLandTypeCategory();

    List<OptionItem> loadValueTagsLandTypeSub(String category);

    String loadLandUsageLabel(Object labelObj, String labelKey);

    List<Filter> setLandUsageLabel(List<Filter> filters, String key);

    Object getLandUsageLabelValByOperatorType(String operator, Object val);

    List<OptionItem> loadValueTagsIndustry();
}

